import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//  app页面路由配置
const appRoute = [
  {
    path: '/home',
    name: 'home',
    meta: {
      keepAlive: true,
    },
    component: () => import( /* webpackChunkName: "event-deal" */ '@/views/home/home.vue')
  },
  {
    path: '/event-deal',
    name: 'event-deal',
    meta: {
      keepAlive: true,
    },
    component: () => import( /* webpackChunkName: "event-deal" */ '@/views/event-deal/index.vue')
  },
  { //  事件详情（我的任务与上报 点击进入）
    path: '/event-detail',
    name: 'event-detail',
    component: () => import( /* webpackChunkName: "event-detail" */ '@/views/event-deal/event-detail.vue')
  },
  { // 事件上报
    path: '/event-report',
    name: 'event-report',
    component: () => import( /* webpackChunkName: "event-report" */ '@/views/event-report/event-report.vue')
  },
  { // 事件查询
    path: '/event-query',
    name: 'event-query',
    component: () => import( /* webpackChunkName: "event-query" */ '@/views/event-query/index.vue')
  },
]


export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    ...appRoute
  ]
})